import sys, os, argparse

if __name__ == '__main__':

  sys.path.insert(0, "..")
  
  desc = "This script produces the directory structure and foundation of a new Spyrim analysis project. "
  parser = argparse.ArgumentParser(description=desc)

  parser.add_argument('-p', '--project_name', required=True, dest='project_name', help='Name of the new Spyrim project. (Required) Note: This will also be the directory name for the project, it may be best to omit spaces and special characters.')
  parser.add_argument('-m', '--module_name', required=True, dest='module', help='Name of the Python module to be created. (Required)')
  parser.add_argument('-a', '--authors', required=True, dest='authors', help='Stores the author(s) name. (Required)')
  parser.add_argument('-d', '--dir', required=True, dest='dir', help='Directory of the new Spyrim project to be created. (Required)')
  # parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', help='Prints more information')

  # args = parser.parse_args()
  args = parser.parse_args(['-p','analysis_project','-m','AnalysisProject','-a','Max Franks','-d','../../some_project'])
  # args = parser.parse_args(['-h'])

  for m in os.listdir(os.path.abspath("..")):
    if str(m) == "__init__.py":
      
      #import module as Python module
      module = __import__(m.split(".")[0])
      
      module.main(args)

  # CHANGE TO 'import spyrim'

